Databases store large amount of data that is processed in response to database queries. Typically databases generate an execution plan for the queries. The execution plan comprises various operators and order of execution of these operators so as to execute a database query. A database query optimizer typically evaluates several execution plans to select a particular query plan for execution. The query optimizer selects the query plan that the optimizer estimates as the best query plan for executing the database query.
Generating the optimal query plan is a complex process that can take significant amount of time depending on the complexity of a query. Query optimizers use statistics describing tables used in queries to determine an execution plan for the query. If the query optimizer does not have statistics describing a table used in a query, the optimizer is likely to select a suboptimal/inferior execution plan.